package com.meridian.commerce.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.meridian.commerce.model.UserAccountAddress;
@Service
public class UserAccountAddressServiceImpl implements EntityCrudService<UserAccountAddress> {

	@Override
	public UserAccountAddress findByPK(Long id) {
		return UserAccountAddress.findUserAccountAddress(id);
		
	}

	@Override
	public UserAccountAddress create(UserAccountAddress entity,Long parentEntityId) {
		entity.persist();
		return entity;
	}

	@Override
	public UserAccountAddress create(UserAccountAddress entity) {
		entity.persist();
		return entity;
	}

	@Override
	public UserAccountAddress update(UserAccountAddress entity) {
		entity.persist();
		return null;
	}

	@Override
	public List<UserAccountAddress> list() {
		return UserAccountAddress.findAllUserAccountAddresses();
	}

	@Override
	public void delete(Long id) {
		UserAccountAddress.findUserAccountAddress(id).remove();
	}

	@Override
	public UserAccountAddress newInstance() {
		UserAccountAddress userAccountAddress = new UserAccountAddress();
		return userAccountAddress;
	}

}
